﻿@model IEnumerable<Student>
@{
  ViewData["Title"] = "学生列表";
  
}

<div class="card-deck">
  @foreach (var student in Model) {
    var avatarPath = "~/images/" + (student.AvatarPath ?? "photo.webp");
    <div class="card m-3">
      <div class="card-header">
        <h3>@student.Name</h3>
      </div>
      <img class="card-img-top" src="@avatarPath" asp-append-version="true" style="height:200px; width:auto; "/>
      <div class="card-footer text-center">
        <a asp-controller="Home" asp-action="detail" asp-route-id="@student.Id"  class="btn btn-primary">查看</a>
        @*@Html.ActionLink("查看","detail","Home", new { id = student.Id })
        <a href="@Url.Action("detail","Home",new { id=student.Id}) ">查看</a>
        <a href="/Home/detail/@student.Id" class="btn btn-primary">查看</a>*@
        <a  asp-controller="Home" asp-action="edit" asp-route-id="@student.Id" class="btn btn-success">编辑</a>
        <a href="#" class="btn btn-danger">删除</a>
      </div>
    </div>
  }
</div>

@section Scripts{
  <script src="~/js/test.js"></script>
}
